import { createRouter, createWebHistory } from "vue-router";
import TabView from "@/layouts/TabView.vue";
import BlackView from "@/layouts/BlackView.vue"

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: "/openClass/player",
      name: "公开课播放",
      component: () => import("@/views/openClass/classPlayer.vue")
    },
    {
      path: "/",
      name: "工作台",
      component: TabView,
      redirect: "/home",
      children: [
        {
          path: "/home",
          name: "首页",
          component: () => import("@/views/home/index.vue"),
          meta: {
            roles: []
          }
        },
        {
          path: "/teachers",
          name: "北邮名师",
          component: BlackView,
          children: [
            {
              path: "",
              name: "北邮名师",
              component: () => import("@/views/teachers/index.vue"),
            },
            {
              path: "/teachers/details",
              name: "名师主页",
              component: () => import("@/views/teachers/teacherDetails.vue")
            }
          ]
        },
        {
          path: "/openClass",
          name: "公开课",
          component: BlackView,
          children:[
            {
              path: "",
              name: "公开课",
              // @ts-ignore
              component: () => import("@/views/openClass/index.vue")
            },
            {
              path: "/openClass/detail",
              name: "公开课详情",
              component: () => import("@/views/openClass/classDetail.vue")
            },

          ]
        },
        {
          path: "/classList",
          name: "班级列表",
          component: () => import("@/views/classList/index.vue")
        }
      ]
    },
    {
      path: "/about",
      name: "about",
      component: () => import("../views/AboutView.vue")
    }
  ]
});

export default router;
